<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
     style="padding: 20px 30px 0 0;" xmlns="http://www.w3.org/1999/html">
    <div class="layui-form-item">
        <div class="layui-col-sm3 layui-col-md3 layui-col-lg3 layui-col-md-offset1">
            <label class="layui-form-label">文章标题</label>
            <div class="layui-input-inline">
                <input id="input_title" type="text" name="title" lay-verify="required" placeholder="请输入标题"
                       autocomplete="off" readonly="true"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3 layui-col-md3 layui-col-lg3">
            <label class="layui-form-label">文章作者</label>
            <div class="layui-input-inline">
                <input id="input_author" type="text" name="author" lay-verify="required" placeholder="请输入姓名"
                       autocomplete="off" readonly="true"
                       class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-col-sm3 layui-col-md3 layui-col-lg3 layui-col-md-offset1">
            <label class="layui-form-label">发布时间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-laydate-type-datetime" placeholder="直接点击选现在"
                       readonly="true">
            </div>
        </div>
        <div class="layui-col-sm3 layui-col-md3 layui-col-lg3">
            <label class="layui-form-label">所属分类</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="select_id" placeholder="直接点击选现在" readonly="true">
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
        <textarea id="textarea_id" name="content" style="width:930px;height:600px;"
                  class="layui-textarea" ></textarea>
    </div>
</div>


<link rel="stylesheet" href="/static/kindeditor-master/themes/default/default.css">
<script src="/static/kindeditor-master/kindeditor-all.js"></script>
<script src='/static/kindeditor-master/kindeditor-all-min.js'></script>
<script src='/static/kindeditor-master/lang/zh-CN.js'></script>
<script>
    layui.use(['index', 'form', 'laydate'], function () {
        var laydate = layui.laydate;
        var $ = layui.$
            , admin = layui.admin
            , element = layui.element
            , form = layui.form

        var router = layui.router();
        var id = router.search.id;
        console.log(id)

        $.ajax({
            url: "/detail_article/",
            type: 'post',
            data: {
                id_back: id,
                //
            },
            success: function (res) {
                console.log(res)
                console.log(res.data[4])
                window.editor = KindEditor.create('#textarea_id');
                document.getElementById("input_title").value= res.data[0];
                document.getElementById("input_author").value = res.data[1];
                document.getElementById("test-laydate-type-datetime").value = res.data[3];
                document.getElementById("select_id").value = res.data[4];
                editor.html(res.data[5])
                // document.getElementById("textarea_id").innerhtml = res.data[4];
            },
        });
    })


</script>

